package com.ezops.poc.validations;

import java.util.LinkedList;
import java.util.List;

import com.ezops.poc.validations.result.FieldValidationError;

public class EzopsValidationException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public EzopsValidationException(TradeIndentifier identifier) {
		super();
		this.tradeIdentifier = identifier;
	}

	private List<FieldValidationError> fieldErrors;
	private TradeIndentifier tradeIdentifier;

	public void addValidationError(FieldValidationError error) {
		if (this.fieldErrors == null)
			fieldErrors = new LinkedList<FieldValidationError>();
		fieldErrors.add(error);
	}

	public List<FieldValidationError> getFieldErrors() {
		return fieldErrors;
	}

	public void setFieldErrors(List<FieldValidationError> fieldErrors) {
		this.fieldErrors = fieldErrors;
	}

	public TradeIndentifier getTradeIdentifier() {
		return tradeIdentifier;
	}

	public void setTradeIdentifier(TradeIndentifier tradeIdentifier) {
		this.tradeIdentifier = tradeIdentifier;
	}
}
